$OpenBSD: patch-powerdevil_daemon_backends_upower_powerdevilupowerbackend_cpp,v 1.3 2015/03/30 17:11:45 zhuk Exp $
--- powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp.orig	Thu Jan 29 21:49:17 2015
+++ powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp	Wed Feb  4 23:29:18 2015
@@ -162,7 +162,14 @@ void PowerDevilUPowerBackend::init()
     bool screenBrightnessAvailable = false;
     m_upowerInterface = new OrgFreedesktopUPowerInterface(UPOWER_SERVICE, "/org/freedesktop/UPower", QDBusConnection::systemBus(), this);
     m_brightnessControl = new XRandrBrightness();
-    if (!m_brightnessControl->isSupported()) {
+    if (m_brightnessControl->isSupported()) {
+        kDebug() << "Using XRandR";
+        m_randrHelper = new XRandRX11Helper();
+        connect(m_randrHelper, SIGNAL(brightnessChanged()), this, SLOT(slotScreenBrightnessChanged()));
+        screenBrightnessAvailable = true;
+    }
+#ifdef HAVE_UDEV
+    else {
         kDebug() << "Using helper";
         KAuth::Action action("org.kde.powerdevil.backlighthelper.syspath");
         action.setHelperID(HELPER_ID);
@@ -175,12 +182,8 @@ void PowerDevilUPowerBackend::init()
             connect(client, SIGNAL(deviceChanged(UdevQt::Device)), SLOT(onDeviceChanged(UdevQt::Device)));
             screenBrightnessAvailable = true;
         }
-    } else {
-        kDebug() << "Using XRandR";
-        m_randrHelper = new XRandRX11Helper();
-        connect(m_randrHelper, SIGNAL(brightnessChanged()), this, SLOT(slotScreenBrightnessChanged()));
-        screenBrightnessAvailable = true;
     }
+#endif
 
     // Capabilities
     setCapabilities(SignalResumeFromSuspend);
